<div class="ui-g-12 p-20">
  <p-panel headerClass="bg-none" [showScroll]="true" marginHeight='80'>
    <p-header>
      <div class="text-right p-6-0">
        <button pButton type="button" (click)="save()" class="btn-success" label="保存"></button>
        <button pButton type="button" (click)="back()" label="取消" class="btn btn-secondary"></button>
      </div>
    </p-header>
    <form #form="ngForm" novalidate class="form-horizontal">
      <div class="ui-lg-12 ui-md-12 ui-g-nopad  head-title">
        模板信息
      </div>
      <div class="table-row">
        <div class="table-cell text-right p-l-25 p-required">
          标题：
        </div>
        <div class="table-cell min-width">
          <input pInputText class="p-input" name="title" maxlength="15" required [(ngModel)]="templateObj.title" placeholder="请输入标题" (blur)="titleCk();"
                 (focus)="titleError =''" [ngClass]="titleError?'p-input-error':''">
        </div>
        <div class="table-cell">
          <p-message *ngIf="titleError" severity="error" [text]="titleError"></p-message>
        </div>
      </div>
      <div class="table-row">
        <div class="table-cell text-right p-l-25 p-required">
          通知类型：
        </div>
        <div class="table-cell min-width">
          <p-dropdown required name="adviceType" [options]="adviceType" placeholder="请选择通知类型" [style]="{width: '100%'}" [(ngModel)]="selectAdviceType"
                      optionLabel="name" (onChange)="adviceTypeCk()" (onfocus)="adviceError = ''"></p-dropdown>
        </div>
        <div class="table-cell">
          <p-message *ngIf="adviceError" severity="error" [text]="adviceError"></p-message>
        </div>
      </div>
      <div class="table-row">
        <div class="table-cell text-right p-l-25 p-required">
          消息类型：
        </div>
        <div class="table-cell min-width">
          <p-dropdown required name="msgType" [options]="msgType" placeholder="请选择消息类型" [style]="{width: '100%'}" [(ngModel)]="selectMsgType"
                      optionLabel="name" (onChange)="msgTypeCk()" (onfocus)="msgTypeError = ''"></p-dropdown>
        </div>
        <div class="table-cell">
          <p-message *ngIf="msgTypeError" severity="error" [text]="msgTypeError"></p-message>
        </div>
      </div>
      <div class="table-row">
        <div class="table-cell text-right p-l-25 p-required">
          触发事件：
        </div>
        <div class="table-cell min-width">
           <textarea [rows]="5" #textarea (focus)="triggerEventError =''" maxlength='100' required name="triggerEvent" Class="width-full" (blur)="triggerEventCk()"
                     pInputTextarea autoResize="true" [(ngModel)]="templateObj.triggerEvent" [ngClass]="triggerEventError?'p-input-error':''"  style="resize: none;width:400px !important;vertical-align: middle;" placeholder="请输入触发事件"></textarea>
          <div class="text-right opacity06" style="padding-left: 292px;text-align: left;">还可输入{{100 - (templateObj.triggerEvent?.length || 0)}}个字</div>
          <!--<input pInputText class="p-input" name="triggerEvent" maxlength="100" required [(ngModel)]="templateObj.triggerEvent" placeholder="请输入触发事件" (blur)="triggerEventCk();"-->
                 <!--(focus)="triggerEventError =''" [ngClass]="triggerEventError?'p-input-error':''">-->
        </div>
        <div class="table-cell">
          <p-message *ngIf="triggerEventError" severity="error" [text]="triggerEventError"></p-message>
        </div>
      </div>
      <div class="table-row">
        <div class="table-cell text-right p-l-25 p-required v-a-t">
          消息内容：
        </div>
        <div class="table-cell">
          <textarea [rows]="10" #textarea (focus)="contentError =''" maxlength='300' required name="content" Class="width-full" (blur)="contentCk()"
                                  pInputTextarea autoResize="true" [(ngModel)]="templateObj.content" [ngClass]="contentError?'p-input-error':''"  style="resize: none;width:400px !important;vertical-align: middle;" placeholder="请输入消息内容"></textarea>
          <div class="text-right opacity06" style="padding-left: 292px;text-align: left;">还可输入{{300 - (templateObj.content?.length || 0)}}个字</div>

        </div>
        <div class="table-cell">
           <p-message *ngIf="contentError" severity="error" [text]="contentError"></p-message>
        </div>
      </div>

    </form>
  </p-panel>
</div>


